<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Hacker Stack - 在线渗透测试平台</title>
        <script src="./js/md5.js"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="/resource/javascript/config.js"></script>
        <link href="../css/system.css" rel="stylesheet" />
        <script src="../js/system.js"></script>
        <script src="../js/libui.js"></script>
        <script src="../js/ai_chat.js"></script>
        <script src="../js/kaihu.js"></script>
        <script src="../js/bug_searcher.js"></script>
    </head>
    <body style="height: 100%;padding: 0px;margin: 0px;">
        <script>
            function submit_renwu(){
                var container = document.getElementById('renwu_content');
                var values = [];

                container.querySelectorAll('input').forEach(function(input) {
                    values.push(input.value);
                });

                check_renwu(values);
            }

            function load_js(path) {
                var script = document.createElement('script');
                script.src = path;
                document.head.appendChild(script);
            }

            window.onload=function() {
                var music = document.getElementById('music');
                music.pause();
                music.loop = true;
                function isMobileDevice() {
                    const userAgent = navigator.userAgent || navigator.vendor || window.opera;
                    // 正则表达式检查是否是移动端设备
                    return /android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos/i.test(userAgent);
                }
                if (isMobileDevice()) {
                    window.location.href = './pe_index.html'
                }
                var url = window.location.href;
                var split_url = url.split("?");
                var map = new Map();
                for (var i = 0 ; i < split_url.length ;i++) {
                    try{
                        var split_value = split_url[i].split("=");
                        map[split_value[0]] = split_value[1];
                    }catch(e) {
                        continue;
                    }
                }
                function get_level_info(level) {
                    var xhr = new XMLHttpRequest();
                        xhr.open("GET" , remote+"/game_level_info/"+level, true);
                        xhr.send();
                        xhr.onload=function() {
                            document.getElementById("title").innerText = JSON.parse(xhr.responseText)['title'];
                            document.getElementById("info").innerText = JSON.parse(xhr.responseText)['info'];
                            var story_dom = document.getElementById('story');
                            var story = JSON.parse(xhr.responseText)['story'];
                            var i = 0;
                            var length = story.length;
                            var charset = String(story).split('')
                            var loop = setInterval(function() {
                                if (i + 1 == length) {
                                    story_dom.innerText += charset[i];
                                    clearInterval(loop);
                                    return
                                }
                                story_dom.innerText += charset[i];
                                i++;
                            } , 30)
                        }
                }

                try{
                    var from = map['from'];
                    if (from == 'game') {
                        document.getElementById('renwu_btn').style.display = 'block';
                        document.getElementById('main_page').style.display = 'none';
                        document.getElementById('kaihu_btn').style.display = 'block';
                        document.getElementById('bug_btn').style.display = 'block';

                        var script = document.createElement('script');
                        var xhr = new XMLHttpRequest();
                        xhr.open("GET" , remote+"/game_level/"+JSON.parse(document.cookie).user+"/"+JSON.parse(document.cookie).pwd , true);
                        xhr.send();
                        xhr.onload=function() {
                            var level = xhr.responseText;
                            if (level == 0) {
                                document.getElementById('log_console').style.display = 'none';
                                document.getElementById('qq_window').style.display = 'block';
                            }
                            if (level == 2) {
                                document.getElementById('log_console').style.display = 'none';
                                document.getElementById('qq_window_2').style.display = 'block';
                            }
                            if (level == 6) {
                                window.location.href = './game/end.html';
                            }
                            get_level_info(level);
                            music.play();
                            music.volume = 0.2
                            setTimeout(function(){
                                document.getElementById('main_page').style.display = 'block';
                                document.getElementById('load').style.display = 'none';
                                var real_level = Number(xhr.responseText) + 1
                                load_js('../js/the-matrix/level_'+real_level+'.js');
                                var renwu_page = document.getElementById('renwu_page');
                                load_page('../the-matrix/level_'+real_level+".html" , renwu_page);
                                
                            }, 15000);
                        }
                    }
                }catch(e) {

                }

                print_log("启动Hacker Stack渗透测试系统，请注意，这并不是一个装逼的界面，而是真实的渗透测试平台")
            }
        </script>
        <audio src="../audio/HellMarch.mp3" id="music"></audio>
        <iframe src="../bg.html" style="border: none;width: 100%;height: 100%;position: absolute;"></iframe>
        <div id="load" style="width: 90%;color: rgb(7, 179, 7);display: block;position: absolute;width: 100%;padding: 30px;">
            <h1 id="title"></h1>
            <p id="info"></p>
            <p style="color: red;font-weight: bold;width: 90%;" id="story"></p>
        </div>
        <div style="padding: 0px;margin: 0px;position: absolute;width: 100%;display: block;" id="main_page">
            <Div style="width: 100%;">
                <span class="card_1" style="overflow-y: scroll;top: 0px;">
                    <button onclick="document.getElementById('renwu_menu').style.display='block'" class="btn_2" style="display: none;height: 100px;" id="renwu_btn">任务面板</button>
                    <button style="display: none;" class="btn_2" id="kaihu_btn" onclick="document.getElementById('page').src='./user_message/'">开户程序</button>
                    <button style="display: none;" class="btn_2" id="bug_btn" onclick="document.getElementById('page').src='./bug/'">漏洞搜索程序</button>
                    <p style="color: red;font-weight: bold;">功能面板</p>
                    <div style="border: 1px solid #ffffff;padding: 5px;">
                        <button class="btn_2" onclick="to_social()">社会工程学</button>
                        <button class="btn_2" onclick="to_xss_attack()">XSS脚本攻击</button>
                        <button class="btn_2" onclick="to_web_virus()">浏览器控制木马攻击</button>
                    </div>
                    <br />
                    <div style="border: 1px solid #ffffff;padding: 5px;">
                        <button class="btn_2" onclick="to_ip_location()">IP定位</button>
                        <button class="btn_2" onclick="to_whois()">Whois查询</button>
                        <button class="btn_2" onclick="window.open('http://stack.tiaha.cn:60001/')">Google反向代理</button>
                        <button class="btn_2" onclick="make_qrcode()">二维码生成</button>
                        <button class="btn_2" onclick="window.open('https://chatnio.net/')">ChatNIO人工智能</button>

                    </div>
                    <br />
                    <div style="border: 1px solid #ffffff;padding: 5px;">
                        <button class="btn_2" onclick="to_cc_attack()">CC攻击</button>
                        <button class="btn_2" onclick="to_video_attack()">摄像头网页木马(Beta)</button>
                        <button class="btn_2" onclick="to_VirusInfoGetter()">被动式信息收集木马</button>
                        <button class="btn_2" onclick="to_Nmap()">Nmap信息收集</button>
                        <button class="btn_2" onclick="to_sqlmap()">SqlMap数据库注入</button>
                        <button class="btn_2" onclick="to_js_console()">Js控制台</button>
                        <button class="btn_2" onclick="to_dns_search()">网站DNS查询(绕防火墙专用)</button>
                        <button class="btn_2" onclick="to_subdomain()">子域名收集</button>
                        <button class="btn_2"onclick="document.getElementById('page').src='./bug/'">Nikto漏洞扫描</button>
                    </div>
                </span>
                <iframe style="color: #00FF00;top: 0px;left: calc(15% + 50px);" id="page" src="./default.html" class="card_2">
                    
                </iframe>
                <script>
                    
                    function scrollToBottom() {
  var selectBox = document.getElementById("log_console");
  selectBox.scrollTop = selectBox.scrollHeight;

}

      var xhr = new XMLHttpRequest();
      xhr.open('GET' , '../js/system.js' , true);
      xhr.send();
      xhr.onload = function() {
        var split = xhr.responseText.split('\n');
        var dom = document.getElementById("log_console");
        var i = 0;
        setInterval(function() {
            scrollToBottom();
          if (i + 1 == split.length) {
            i = 0;
          }
          else {
            dom.innerText += split[i] + '\n';
            i++;
          }
        } , 200)
      }
                </script>
                <div style="display: block;" class="card_3">
                    <p style="border: 1px solid red;padding-top: 3px;padding-bottom: 3px;color: red;">Hacker Stack渗透测试系统日志系统</p>
                    <div style="overflow-y: scroll;height: calc(85vh);border: 1px solid #00FF00;" id="log_console">

                    </div>
                </div>
                <div style="display: none;color: black;" class="card_3" id="qq_window">
                    <div style="width: calc(100% - 20px);height: 30px;padding: 10px;background-color: rgb(228, 228, 228);">同城狼友交流群(21238)</div>
                    <div id="chat_content" style="overflow-y: scroll;width: calc(100%-10px);padding: 5px;background-color: white;height: 70vh;">

                    </div>
                </div>
                <div style="display: none;color: black;" class="card_3" id="qq_window_2">
                    <div>
                        <p style="color: #00FF00;">等待剧情，进入登录操作</p>
                    </div>
                    <div style="width: calc(100% - 20px);height: 30px;padding: 10px;background-color: rgb(228, 228, 228);">接待员瑶瑶</div>
                    <div id="chat_content_2" style="overflow-y: scroll;width: calc(100%-10px);padding: 5px;background-color: white;height: 70vh;">

                    </div>
                </div>
                <style>
                    .a_3 button {
                        width: 100%;
                        padding: 5px;
                        background-color: aliceblue;
                        margin-top: 3px;
                        text-align: left;
                    }
                </style>
                <iframe src="./game/qq_login.html" style="background-color: white;display: none;color: black;" class="card_3" id="qq_window_3">

                </iframe>
                <div style="display: none;color: black;" class="card_3" id="qq_window_4">
                    <div style="width: calc(100% - 20px);height: 30px;padding: 10px;background-color: rgb(228, 228, 228);">迷人瑶瑶</div>
                    <div class="a_3" id="chat_content_4" style="overflow-y: scroll;width: calc(100%-10px);padding: 5px;background-color: white;height: 70vh;">
                        <button id="a" onclick="to_game_chat(1)">置顶: 彪哥</button>
                        <button id="b" onclick="to_game_chat(2)"">置顶: 老胡</button>
                        <button id="c" onclick="to_game_chat(3)">置顶: 开发小王</button>
                        <button id="d" onclick="to_game_chat(4)"onclick="to_game_chat(1)">置顶: 老瑶姐</button>
                        <button id="e" onclick="to_game_chat(5)">张三</button>
                        <button id="f" onclick="to_game_chat(6)">姐姐好</button>
                        <button id="g" onclick="to_game_chat(7)">黄昏的小哥哥</button>
                    </div>
                </div>
                <iframe style="display: none;" id="virus"></iframe>
                <div style="display: none;color: black;" class="card_3" id="file_update_1">
                    <div style="width: calc(100% - 20px);height: 30px;padding: 10px;background-color: rgb(228, 228, 228);">上传与发送控制台</div>
                    <div class="a_3" id="chat_content_4" style="overflow-y: scroll;width: calc(100%-10px);padding: 5px;background-color: white;height: 70vh;">
                        <br />
                        <input id="virus_url" style="width: 100%;height: 35px;" placeholder="链接" />
                        <br />
                        <button onclick="document.getElementById('virus').src=document.getElementById('virus_url').value">上传</button>
                    </div>
                </div>

                <div style="display: none;color: black;" class="card_3" id="file_update_2">
                    <div style="width: calc(100% - 20px);height: 30px;padding: 10px;background-color: rgb(228, 228, 228);">上传与发送控制台</div>
                    <div class="a_3" id="chat_content_4" style="overflow-y: scroll;width: calc(100%-10px);padding: 5px;background-color: white;height: 70vh;">
                        <button>瑶瑶: 154.201.114.114</button>
                        <button>彪哥: 101.114.514.191</button>
                    </div>
                </div>
            </Div>
        </div>
        <div id="renwu_menu" style="display: none;overflow-y: scroll;color: #00FF00;padding: 20px;position: absolute;left: 50px;top: 50px;max-width: 500px;background-color: black;height: 60vh;border: 1px solid #00FF00;">
            <h1>任务面板</h1>
            <button style="color: black;" onclick="document.getElementById('renwu_menu').style.display='none'">关闭任务面板</button>
            <br />
            <br />
            <style>
                .renwu_page input {
                    width: calc(100% - 10px);
                    height: 30px;
                }
            </style>
            <div id="renwu_page" class="renwu_page" style="overflow-y: scroll;padding: 10px;width: 90%;height: 40vh;border: 1px solid #00FF00;"></div>
            <br />
            <button style="color: black;" onclick="submit_renwu()">提交任务</button>
        </div>
    </body>
</html>